package me.xiaoyan.android.tuition.activity;

import me.xiaoyan.android.tuition.R;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Help extends Common {
	private LayoutInflater inflater = null;
	private LinearLayout lv_help_box = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_common_scroller);

		inflater = LayoutInflater.from(this);
		lv_help_box = (LinearLayout) findViewById(R.id.lv_scroll_box);
		String[] titles = getResources().getStringArray(
				R.array.help_items_title);
		String[] contents = getResources().getStringArray(
				R.array.help_items_content);
		for (int i = 0; i < titles.length; i++) {
			addHelp(titles[i], contents[i]);
		}
	}

	private void addHelp(String title, String content) {
		View v = inflater.inflate(R.layout.ui_help_item, null);
		((TextView) v.findViewById(R.id.txt_help_title)).setText(title);
		((TextView) v.findViewById(R.id.txt_help_content)).setText(content);
		lv_help_box.addView(v);
	}
}
